Return to doc.sitecore.com

Valid for Sitecore 5.3, 5.2
Preview throws exceptions about codeblocks in controls (<%...%>)

Q:

Preview throws exceptions about codeblocks in controls (<%...%>). Why?

A:

The matter is that <%#   %>  inline statement should be used instead of  <%=   %> when you add these blocks into layout. E.g.: 

        <meta id=scID content="<%#Sitecore.Context.Item.ID%>" name=scID>
        <meta id=scPath content="<%#Sitecore.Context.Item.Paths.Path%>" name=scPath>

You should also change the AutomaticDataBind setting to true in the web.config file.